<template>
	<view class="orderHome">
		<view class="banner">
			<u-swiper :list="list" height="400"></u-swiper>
			<!-- 订单提醒 -->
			<view class="warn-box">
				<view class="left">
					<image src="../../static/img/orderHome/order-warn-icon.png" mode="widthFix"></image>
				</view>
				<view class="right">
					您有新的玩具订单，请及时处理！
				</view>
			</view>
		</view>
		<view class="orderHome-plate-1">
			<view class="item" @click="onScanCode">
				<view class="top-icon">
					<image src="../../static/img/orderHome/QR-icon.png" mode="widthFix"></image>
				</view>
				<text>扫一扫</text>
			</view>
			<navigator url="handleVip/handleVip" hover-class="none" open-type="navigate">
				<view class="item">
					<view class="top-icon">
						<image src="../../static/img/orderHome/vip-icon.png" mode="widthFix"></image>
					</view>
					<text>办卡/续费</text>
				</view>
			</navigator>
			<navigator url="abnormal/abnormal" hover-class="none" open-type="navigate">
				<view class="item">
					<view class="top-icon">
						<image src="../../static/img/orderHome/warn-icon.png" mode="widthFix"></image>
					</view>
					<text>异常入库</text>
				</view>
			</navigator>
		</view>
		<view class="orderHome-plate-2">
			<view class="title">
				<view class="title-left">
					购买订单
				</view>
				<view class="title-right daj-center" @click="goOrderList(5)">
					<text>全部订单</text>
					<u-icon name="arrow-right" color="#A0A0A0" size="18"></u-icon>
				</view>
			</view>
			<view class="content">
				<view class="item" @click="goOrderList(0)">
					<view class="item-top">
						<image src="../../static/img/orderHome/daifukuan-color.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>待付款</text>
				</view>
				<view class="item" @click="goOrderList(1)">
					<view class="item-top">
						<image src="../../static/img/orderHome/daifahuo-color.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>待发货</text>
				</view>
				<view class="item" @click="goOrderList(2)">
					<view class="item-top">
						<image src="../../static/img/orderHome/yifahuo-color.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>已发货</text>
				</view>
				<view class="item" @click="goOrderList(3)">
					<view class="item-top">
						<image src="../../static/img/orderHome/daipingjia-color.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>待评价</text>
				</view>
				<navigator url="afterSale/afterSale" hover-class="none" open-type="navigate">
					<view class="item">
						<view class="item-top">
							<image src="../../static/img/orderHome/shouhou-color.png" mode="widthFix"></image>
							<view class="order-num">
								0
							</view>
						</view>
						<text>退款/售后</text>
					</view>
				</navigator>
			</view>
		</view>
		<view class="orderHome-plate-3">
			<view class="title">
				<view class="title-left">
					租赁订单
				</view>
				<view class="title-right daj-center">
					<text>全部订单</text>
					<u-icon name="arrow-right" color="#A0A0A0" size="18"></u-icon>
				</view>
			</view>
			<view class="content">
				<view class="item" @click="goRentOrder">
					<view class="item-top">
						<image src="../../static/img/orderHome/daifahuo.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>待发货</text>
				</view>
				<view class="item" @click="goRentOrder">
					<view class="item-top">
						<image src="../../static/img/orderHome/zulin.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>租赁中</text>
				</view>
				<view class="item" @click="goRentOrder">
					<view class="item-top">
						<image src="../../static/img/orderHome/daiguihuan.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>待归还</text>
				</view>
				<view class="item" @click="goRentOrder">
					<view class="item-top">
						<image src="../../static/img/orderHome/yiguihuan.png" mode="widthFix"></image>
						<view class="order-num">
							0
						</view>
					</view>
					<text>已归还</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
						title: '昨夜星辰昨夜风，画楼西畔桂堂东'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
						title: '身无彩凤双飞翼，心有灵犀一点通'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
						title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
					}
				],
			};
		},
		methods:{
			// 跳转到租赁订单列表
			goRentOrder(){
				uni.navigateTo({
					url:'rentOrder/rentOrder'
				})
			},
			// 调起扫一扫
			onScanCode(){
				uni.scanCode({
					success: (res) => {
						console.log(res)
					}
				})
			},
			// 跳转到购买订单列表
			goOrderList(num){
				uni.navigateTo({
					url:'orderList/orderList?index=' + num
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.orderHome{
	width: 100vw;
	min-height: 100vh;
	background-color: $bg-color;
	.banner{
		position: relative;
		/deep/.u-swiper-wrap{
			.u-swiper-indicator{
				bottom: 78rpx!important;
			}	
		}
		.warn-box{
			width: 690rpx;
			height: 80rpx;
			background: #ffffff;
			border-radius: 20rpx;
			display: flex;
			align-items: center;
			position: absolute;
			top: 340rpx;
			left: 30rpx;
			.left{
				width: 180rpx;
				height: 30rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				border-right: 1rpx solid #999;
				image{
					width: 124rpx;
				}
			}
			.right{
				width: 500rpx;
				padding: 0 30rpx;
				overflow: hidden;
				-webkit-line-clamp: 1;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
			}
		}
	}
	.orderHome-plate-1{
		width: 690rpx;
		height: 232rpx;
		background: #ffffff;
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 55rpx;
		margin: 50rpx auto 30rpx auto;
		.item{
			display: flex;
			flex-direction: column;
			align-items: center;
			.top-icon{
				display: flex;
				align-items: center;
				justify-content: center;
				width: 120rpx;
				height: 120rpx;
				background: #f3f8ff;
				border-radius: 50%;
				margin-bottom: 20rpx;
				image{
					width: 60rpx;
				}
			}
			text{
				font-size: 24rpx;
				color: #333333;
			}
		}
	}
	.orderHome-plate-2,.orderHome-plate-3{
		width: 710rpx;
		height: 229rpx;
		background: #ffffff;
		border-radius: 10rpx;
		padding: 0 18rpx;
		margin: 0 auto;
		.title{
			height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #f5f5f5;
			.title-left{
				font-size: 30rpx;
				font-weight: bold;
				color: #141d34;
			}
			.title-right{
				text{
					font-size: 24rpx;
					color: #999999;
					margin-right: 17rpx;
				}
				
			}
		}
		.content{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;
			.item{
				display: flex;
				flex-direction: column;
				align-items: center;
				.item-top{
					position: relative;
					width: 64rpx;
					padding-top: 10rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-bottom: 18rpx;
					image{
						width: 44rpx;
					}
					.order-num{
						position: absolute;
						right: 0;
						top: 0;
						width: 30rpx;
						height: 30rpx;
						background: #ff6b35;
						text-align: center;
						font-size: 24rpx;
						border-radius: 50%;
						line-height: 30rpx;
						color: #ffffff;
						
					}
				}
				text{
					font-size: 24rpx;
					color: #666666;
				}
			}
		}
	}
	.orderHome-plate-3{
		margin-top: 30rpx;
		.content{
			padding: 0 50rpx;
		}
	}
}
</style>
